<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>个人中心 - 个人资料</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="../js/vue.min.js"></script>
    <script src="../js/axios.min.js"></script>
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <link href="https://www.hn-vs.cn/template/image/favicon.ico" rel="icon" type="image/x-icon">
    <link href="https://www.hn-vs.cn/template/image/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="https://www.hn-vs.cn/template/image/favicon.ico" rel="bookmark" type="image/x-icon">
    <link href="res/base.css" rel="stylesheet" type="text/css">
    <link href="res/head.css" rel="stylesheet" type="text/css">
</head>
<style>
    #cart{
        padding: 2px;
    }
</style>
<body id="centerBody">
<div id="app">
    <div class="headdiv"></div>
    <input type="hidden" id="_SELF_ID" value="18314486">
    <input type="hidden" id="_DOMAIN" value="hn-vs.cn">
    <link rel="stylesheet" href="res/chartbar.css">
    <link rel="stylesheet" type="text/css" href="res/tree.css">
    <link rel="stylesheet" type="text/css" href="res/icon.css">

    <div class="bodydiv" >
        <link href="res/bodyleft.css" rel="stylesheet" type="text/css">
        <link href="res/help.css" rel="stylesheet" type="text/css">
        <link href="res/Changes.css" rel="stylesheet" type="text/css">
        <style>
            .infspan {
                width: 110px;
                display: inline-block;
                text-align: right;
                padding-right: 5px
            }
        </style>
        <div id="bodyright">
            <link href="res/set.css" rel="stylesheet" type="text/css">
            <div id="Set">
                <div id="setimage"><img src="res/setup.png"></div>
                <div id="little">
                    <div id="little2">
                        <h2>个人信息</h2>
                    </div>
                    <div id="back"><a href="javascript:history.go(-1);">&lt;&lt; 返回上一页</a></div>
                </div>
                <div id="Navigation">
                    <a href="modifyhead.htm">
                        <div class="Navigation2">头像上传及修改</div></a>
                    <div class="Navigation3">修改及完善个人资料</div>
                </div>
            </div>
            <div style="color:red;margin-left:20px;"></div>
            <div id="card">
                <form onsubmit="false" action="https://www.hn-vs.cn/~set!personal" name="frmPersonal" id="frmPersonal" method="POST"
                      enctype="multipart/form-data">
                    <input type="hidden" name="citiesId" value="0">
                    <input type="hidden" name="districtId" value="0">
                    <input type="hidden" name="streetId" value="0">
                    <input type="hidden" name="communityId" value="0">
                    <input type="hidden" name="provinceunitId" value="0">
                    <input type="hidden" name="companyId" value="0">
                    <input type="hidden" name="unitId" value="0">
                    <input type="hidden" name="universityCityId" value="0">
                    <input type="hidden" name="universityId" value="0">
                    <input type="hidden" name="collegeId" value="0">
                    <ul v-if="loginedUser">
                        <li>
                            <div class="hang">
                                <div id="mail"><span class="infspan">email:</span></div>
                                <div id="name" style="display:none;"></div>
                                <div id="mail1">{{loginedUser.email}}</div>
                            </div>
                        </li>
                        <li>
                            <div class="hang">
                                <span class="infspan"><font color="red">*</font>昵称:</span>
                                <input  type="text" v-model="editinfo.nickName" class="text1 noIme" maxlength="200" id="nick_name"
                                        value="编辑昵称。">
                            </div>
                        </li>
                        <li>
                            <div class="hang">
                                <span class="infspan"><font color="red">*</font>签名:</span>
                                <input  type="text" style="width: 340px" v-model="editinfo.sign" class="text1 noIme" maxlength="200" id="sign"
                                        value="编辑个签，展示你的独特态度。">
                            </div>
                        </li>

                        <li>
                            <div class="hang"><span class="infspan"><font color="red">*</font>密码:</span>
                                <input  type="password" name="password" class="text1 noIme" maxlength="200" id="password"
                                        value="{{loginedUser.password}}">
                            </div>

                            <a @click="showModifyInfo()"><div id="change"> 修改密码 </div></a>

                        </li>
                        <li>
                            <div class="hang"><span class="infspan" id="is_boy">性别:</span>
                                <label>
                                    <select v-model="editinfo.boyText" id="sex" svalue="0">
                                        <option value="1" > 男</option>
                                        <option value="0">女</option>
                                    </select>
                                </label>
                            </div>
                        </li>
                        <li>
                            <div class="hang"><span class="infspan"><font color="red">*</font>年龄:</span>
                                <label></label>
                                <label>
                                    <input v-model="editinfo.age" type="text" name="birthYear" id="birthYear">
                                </label>
                            </div>
                        </li>

                        <li>
                            <div class="hang"><span class="infspan"><font color="red">*</font>注册时间:</span>
                                <label>{{loginedUser.regTime}}
                                    <!--  <input type="text" name="reg_time" class="text1 noIme" maxlength="200" id="reg_time"
                                             value="">-->
                                </label>
                            </div>
                        </li>

                    </ul>
                    <div id="buttom" @click="modify()">保存</div>
                </form>
            </div>
        </div>
    </div>
    <link rel="stylesheet" href="res/foot.css">
    <div class="footdiv">
        <div class="footdiv1">
            <span style="cursor:pointer;" onclick="window.open(&#39;!&#39;)">HNVS.CN</span> |
            <span style="cursor:pointer;" onclick="window.open(&#39;!about&amp;t=1&#39;)">关于我们</span> |
            <span style="cursor:pointer;" onclick="window.open(&#39;!about&amp;t=7&#39;)">意见反馈</span> |
            <span style="cursor:pointer;" onclick="window.open(&#39;!about&amp;t=6&#39;)">使用帮助</span> |
            <span style="cursor:pointer;" onclick="window.open(&#39;!about&amp;t=3&#39;)">联络我们</span> |
            <span style="cursor:pointer;" onclick="window.open(&#39;!about&amp;t=8&#39;)">商务合作</span>
        </div>
        <div class="footdiv2">@ 2012-2022 hnvs.cn, All Rights Reserved.&nbsp;&nbsp;&nbsp;&nbsp;湘ICP备13009455号-1</div>
    </div>

</div>



<script>
    var v = new Vue({
        el:"#app",
        data:{
            loginedUser : '',
            editinfo:{  nickName: '',sign:'',isBoy : '',age:'',boyText:''}
        },
        created(){
            axios.get("sp-user/cloudvideo/user/getLoginedUser").then(res=>{
                if(res.data.code){
                    this.loginedUser = res.data.data;
                    console.info( this.loginedUser )
                    this.editinfo.nickName=this.loginedUser.nickName;
                    this.editinfo.sign=this.loginedUser.sign;
                    this.editinfo.isBoy=this.loginedUser.isBoy;
                    this.editinfo.age=this.loginedUser.age;
                    console.log("=================",this.editinfo.isBoy)
                    if(this.editinfo.isBoy){
                        this.editinfo.boyText="1"
                    }else {
                        this.editinfo.boyText="0"
                    }
                }
            })
        },
        methods:{
            showModifyInfo(){
                window.open("modifyPwd.htm",null,"height=350,width=340,status=yes,left=50%,top=50%, toolbar=no,menubar=no");
            },
            logout(){
                axios.get("sp-user/cloudvideo/user/logout").then(res=>{
                    this.user = null;
                })
            },
            modify(){
                let params = new URLSearchParams();
                params.append("nickName", this.editinfo.nickName);
                params.append("sign", this.editinfo.sign);
                params.append("isBoy", this.editinfo.isBoy);
                params.append("age", this.editinfo.age);
                axios.post("sp-user/cloudvideo/user/updateUserInfo",params).then(res=>{
                    console.info( this.editinfo.nickName);

                    if (res.data.code == 1) {
                        alert("信息保存成功！")
                    } else {
                        alert(res.data.msg);
                    }

                })
            }
        }
    })
</script>
</body>
</html>